/********************************************************************************
 *      Copyright:  (C) Guo Zixuan
 *                  All rights reserved.
 *
 *       Filename:  get_temp.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(06/04/25)
 *         Author:  Guo Zixuan <guozixuan@gmail.com>
 *      ChangeLog:  1, Release initial version on "06/04/25 16:18:14"
 *                 
 ********************************************************************************/
#ifndef _GET_DATA_H_
#define _GET_DATA_H_

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <dirent.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <dirent.h>
#include <sys/time.h>
#include <getopt.h>
#include <stdint.h>
#include <arpa/inet.h>
#include "logger.h"

#define CRC16_ITU_T_POLY 0x1021

typedef struct {
	char	sn[20];
	float	temp;
	char	mytime[20];
} data_t;

typedef int (* pack_proc_t)(data_t *data, uint8_t *buf, int size);

int get_temp(float *temp);
void get_time(char *mytime, int size);
void get_sn(char *sn, int size);
int get_package(data_t *data, uint8_t *buf, int size);
int get_package_json(data_t *data, uint8_t *buf, int size);
int get_package_tlv(data_t *data, uint8_t *buf, int size);
static uint16_t crc_itu_t(const uint8_t *data, size_t length);

#endif

